home *** CD-ROM | disk | FTP | other *** search
- head 1.2;
- branch ;
- access ;
- symbols sprited:1.2.1;
- locks jhh:1.2; strict;
- comment @ * @;
-
-
- 1.2
- date 90.09.12.09.31.37; author rab; state Exp;
- branches 1.2.1.1;
- next 1.1;
-
- 1.1
- date 88.06.30.11.06.49; author ouster; state Exp;
- branches ;
- next ;
-
- 1.2.1.1
- date 92.06.07.20.35.51; author kupfer; state Exp;
- branches ;
- next ;
-
-
- desc
- @@
-
-
- 1.2
- log
- @replaced fseek(hostFile, 0, SET_SEEK) with rewind(hostFile). SET_SEEK is not
- defined by sunOS, and rewind is clearer anyway.
- @
- text
- @/*
- * Host_Start.c --
- *
- * Source code for the Host_Start library procedure.
- *
- * Copyright 1988 Regents of the University of California
- * Permission to use, copy, modify, and distribute this
- * software and its documentation for any purpose and without
- * fee is hereby granted, provided that the above copyright
- * notice appear in all copies. The University of California
- * makes no representations about the suitability of this
- * software for any purpose. It is provided "as is" without
- * express or implied warranty.
- */
-
- #ifndef lint
- static char rcsid[] = "$Header: /sprite/src/lib/c/host/RCS/Host_Start.c,v 1.1 88/06/30 11:06:49 ouster Exp Locker: rab $ SPRITE (Berkeley)";
- #endif not lint
-
- #include <stdio.h>
- #include <host.h>
-
- /*
- * Information about the current host database file:
- */
-
- FILE * hostFile = (FILE *) NULL;
- char * hostFileName = "/etc/spritehosts";
-
- /*
- *-----------------------------------------------------------------------
- *
- * Host_Start --
- *
- * Begin reading from the the current host file.
- *
- * Results:
- * 0 is returned if all went well. Otherwise -1 is returned
- * and errno tells what went wrong.
- *
- * Side Effects:
- * If the file was open, it is reset to the beginning. If it was not
- * open, it is now.
- *
- *-----------------------------------------------------------------------
- */
-
- int
- Host_Start()
- {
- if (hostFile != (FILE *) NULL) {
- rewind(hostFile);
- } else {
- hostFile = fopen(hostFileName, "r");
- if (hostFile == (FILE *) NULL) {
- return -1;
- }
- }
- return 0;
- }
- @
-
-
- 1.2.1.1
- log
- @Initial branch for Sprite server.
- @
- text
- @d17 1
- a17 1
- static char rcsid[] = "$Header: /sprite/src/lib/c/host/RCS/Host_Start.c,v 1.2 90/09/12 09:31:37 rab Exp Locker: jhh $ SPRITE (Berkeley)";
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d17 1
- a17 1
- static char rcsid[] = "$Header: proto.c,v 1.2 88/03/11 08:39:08 ouster Exp $ SPRITE (Berkeley)";
- d52 1
- a52 1
- fseek(hostFile, 0, SEEK_SET);
- @
-